<template>
  <div>
    <div class="banner" @click="handleBannerClick">
      <img class="banner-img"
        :src="bannerImg"
        alt="picture">
      <div class="banner-info">
        <div class="banner-number">
          <span class="iconfont">&#xe604;</span>
          39
        </div>
        <div class="banner-title">{{ sightName }}</div>
      </div>
    </div>
    <fade-animation>
      <common-gallary :imgs="gallaryImgs" v-show="showGallary"
        @close="handleGallaryClose">
      </common-gallary>
    </fade-animation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  components: {
    CommonGallary,
    FadeAnimation
  },
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      showGallary: false
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style lang="stylus" scoped>
  .banner
    position relative
    overflow hidden
    height 0
    padding-bottom 55%
    .banner-img
      width 100%
    .banner-info
      position absolute
      bottom 0
      left 0
      right 0
      padding 0 .2rem
      line-height .8rem
      background-image linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, .6))
      .banner-number
        width 1.2rem
        line-height .4rem
        border-radius .2rem
        font-size .24rem
        text-align center
        color #fff
        background rgba(0, 0, 0, .5)
        .iconfont
          font-size .24rem
      .banner-title
        color #fff
        font-size .36rem
</style>
